@use 'sass:map';
@use '@angular/material' as mat;

@mixin color($config-or-theme) {
  $config: mat.get-color-config($config-or-theme);
  $foreground: map.get($config, foreground);
  $primary: map.get($config, primary);
  $warn: map.get($config, warn);

  .pac-auth {
    .mtx-alert {
      &.mtx-alert-success {
        color: mat.get-color-from-palette($primary, '200-contrast');
        background-color: mat.get-color-from-palette($primary, 200);
      }
      &.mtx-alert-warning.mtx-alert {
        color: mat.get-color-from-palette($warn, '500-contrast');
        background-color: mat.get-color-from-palette($warn);
      }
    }

    .ngm-button {
      &.ngm-button-disabled {
        @apply opacity-50 cursor-not-allowed;
      }
    
      &:not(.ngm-button-disabled) {
        @apply hover:from-green-400 hover:to-blue-600 hover:text-white;
      }
    }
  }
}

@mixin density($config-or-theme) {
}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
